package xyz.lwm.lazycat.web.util;

import xyz.lwm.lazycat.web.handle.Context;

/**
 * http context thread local
 *
 * @author lwm
 */
public abstract class ContextHolder {

    private static final ThreadLocal<Context> CONTEXT_LOCAL = new ThreadLocal<>();

    public static Context get() {
        return CONTEXT_LOCAL.get();
    }

    public static void set(Context context) {
        CONTEXT_LOCAL.set(context);
    }

    public static void clear() {
        CONTEXT_LOCAL.remove();
    }

}
